﻿<%@ Page Language="C#" AutoEventWireup="true"  validaterequest="false"  CodeBehind="index.aspx.cs" Inherits="AnyOffice.general.notify.manage._new" %>

<%@ Register TagPrefix="fckeditorv2" Namespace="FredCK.FCKeditorV2" Assembly="FredCK.FCKeditorV2" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
	<HEAD>
		<title>文件下发</title>
		
		<link rel="stylesheet" type="text/css" href="/module/date_selector/popcalendar.css">
		<script src="/module/date_selector/popcalendar.js"></script>
		<script src="/aspnet_client/core/function.js"></script>
		<script Language="JavaScript">		
		function CheckForm()
		{
			if (document.getElementById("ddlTypeId").length == 1)
			{
				alert("请先定义文件通知类型！");
				return (false);
			}
			
			if (document.Form1.ToId.value=="" && document.Form1.ToPriv.value=="" && document.Form1.ToUser.value=="")
			{
				alert("请指定发布范围！");
				return (false);
			}

			if (document.Form1.txtSubject.value=="")
			{
				alert("文件通知的标题不能为空！");
				document.Form1.txtSubject.focus();
				return (false);
			}
			
			if (document.getElementById("ddlTypeId").value == "")
			{
				alert("请选择文件通知类型！");
				return (false);
			}
			   
			if(!checkIsDate(document.Form1.txtBeginDate.value))
			{
				alert("开始日期不正确！");
				document.Form1.txtBeginDate.focus();
				return (false);
			}
			   
			if(!checkIsDate(document.Form1.txtEndDate.value))
			{
				alert("结束日期不正确！");
				document.Form1.txtEndDate.focus();
				return (false);
			}
			   
			var oEditor = FCKeditorAPI.GetInstance('txtContent');
			if(oEditor.GetHTML() == "")  
			{
				alert("文件的内容不能为空！");
				return (false);
			}
			return true;
		}

		function CheckFile()
		{
			if (document.Form1.fileAttach.value=="")
			{
				alert("请选择附件！");
				return (false);
			}   
			return true;	
		}		
		</script>
	</HEAD>
	<body class="bodycolor" topmargin="5">
		<form id="Form1" method="post" runat="server">
		<asp:Panel id="pnlMain" runat="server">
			<table border="0" width="90%" cellspacing="0" cellpadding="3" class="small">
				<tr>
					<td class="Big">
						<IMG src="/images/notify_new.gif" align="absMiddle" width="18" height="18"> <span class="big3">新建文件通知</span>
					</td>
				</tr>
			</table>			
			<br>
				<TABLE class="small" cellSpacing="1" cellPadding="2" align="center" bgColor="#000000" border="0" width="90%">
					<TR>
						<TD class="TableData">发布范围（部门）：</TD>
						<TD class="TableData"><INPUT id="ToId" type="hidden" name="ToId" runat="server"> <TEXTAREA class="BigStatic" id="ToName" name="ToName" rows="2" readOnly wrap="yes" cols="50"
								runat="server"></TEXTAREA> &nbsp;<INPUT class="SmallButton" title="添加部门" onclick="dept_select('ToId','ToName','');" type="button" value="添 加"
								name="button"> &nbsp;<INPUT class="SmallButton" title="清空部门" onclick="clear_double('ToId','ToName');" type="button" value="清 空"
								name="button">
						</TD>
					</TR>
					<TR>
						<TD class="TableData">发布范围（角色）：</TD>
						<TD class="TableData"><INPUT id="ToPriv" type="hidden" name="ToPriv" runat="server"> <TEXTAREA class="BigStatic" id="ToPrivName" name="ToPrivName" rows="2" readOnly wrap="yes" cols="50"
								runat="server"></TEXTAREA> &nbsp;<INPUT class="SmallButton" title="选择角色" onclick="priv_select('ToPriv','ToPrivName','');" type="button" value="选 择"
								name="button"> &nbsp;<INPUT class="SmallButton" title="清空角色" onclick="clear_double('ToPriv','ToPrivName');" type="button" value="清 空"
								name="button">
						</TD>
					</TR>
					<TR>
						<TD class="TableData">发布范围（人员）：</TD>
						<TD class="TableData"><INPUT id="ToUser" type="hidden" name="ToUser" runat="server"> <TEXTAREA class="BigStatic" id="ToUserName" name="ToUserName" rows="2" readOnly wrap="yes" cols="50"
								runat="server"></TEXTAREA> &nbsp;<INPUT class="SmallButton" title="选择人员" onclick="user_select('ToUser','ToUserName','');" type="button" value="选 择"
								name="button"> &nbsp;<INPUT class="SmallButton" title="清空人员" onclick="clear_double('ToUser','ToUserName');" type="button" value="清 空"
								name="button">
						</TD>
					</TR>
					<TR>
						<TD class="TableData" noWrap>标题：</TD>
						<TD class="TableData">
							<asp:TextBox id="txtSubject" runat="server" MaxLength="100" CssClass="BigInput" Columns="50"></asp:TextBox></TD>
					</TR>
					<TR>
						<TD class="TableData" noWrap>类型：</TD>
						<TD class="TableData"><asp:DropDownList id="ddlTypeId" runat="server" CssClass="BigSelect" DataValueField="TypeId" DataTextField="TypeName"></asp:DropDownList></TD>
					</TR>
					<TR>
						<TD class="TableData" noWrap>有效期：</TD>
						<TD class="TableData">生效日期：<INPUT class="BigInput" id="txtBeginDate" ondblclick="document.Form1.txtBeginDate.value='';"
								type="text" maxLength="10" size="12" name="txtSendTimeMIN" runat="server"> <IMG style="CURSOR: hand" onclick="popUpCalendar(this,txtBeginDate,'yyyy-mm-dd','');"
								src="/module/date_selector/calendar.gif" align="absMiddle" border="0"> 为空为立即生效<BR>
							终止日期：<INPUT class="BigInput" id="txtEndDate" ondblclick="document.Form1.txtEndDate.value='';"
								type="text" maxLength="10" size="12" name="txtSendTimeMIN" runat="server"> <IMG style="CURSOR: hand" onclick="popUpCalendar(this,txtEndDate,'yyyy-mm-dd','');" src="/module/date_selector/calendar.gif"
								align="absMiddle" border="0"> 为空为手动终止
						</TD>
					</TR>
					<TR>
						<TD class="TableData" noWrap>附件：</TD>
						<TD class="TableData">
							<asp:Panel id="pnlAttach" runat="server" Visible="False">
								<asp:ListBox id="ltbFileList" runat="server" Rows="1"></asp:ListBox>
								<asp:button id="btnRemoveFile" runat="server" CssClass="SmallButton" Text="删除" onclick="btnRemoveFile_Click"></asp:button>
							</asp:Panel></TD>
					</TR>
					<TR>
						<TD class="TableData" noWrap>附件上传：</TD>
						<TD class="TableData"><INPUT class="SmallInput" id="fileAttach" type="file" size="26" name="fileAttach" runat="server">
							<asp:button id="btnAddFile" runat="server" CssClass="SmallButton" Text="添加" onclick="btnAddFile_Click"></asp:button></TD>
					</TR>
					<TR>
						<TD class="TableData" noWrap>提醒：</TD>
						<TD class="TableData">
							<asp:CheckBox id="ckbSms" runat="server" Text="使用内部短信提醒员工" Checked="True"></asp:CheckBox>
							<asp:CheckBox id="ckbMobile" runat="server" Visible="false"   Text=""></asp:CheckBox></TD>
					</TR>
					<TR>
						<TD class="TableData" noWrap>置顶：</TD>
						<TD class="TableData">
							<asp:CheckBox id="ckbImportant" runat="server" Text="使文件通知置顶，显示为重要"></asp:CheckBox></TD>
					</TR>
					<TR>
						<TD class="TableData" noWrap>文件内容：</TD>
						<TD class="TableData">
							<FCKeditorV2:FCKeditor id="txtContent" runat="server" Width="100%" Height="350px"></FCKeditorV2:FCKeditor></TD>
					</TR>
					<TR class="TableControl" align="center">
						<TD noWrap colSpan="2">
							<asp:Button id="btnSubmit" runat="server" CssClass="BigButton" Text="发布" onclick="btnSubmit_Click"></asp:Button>&nbsp;&nbsp;&nbsp;&nbsp;
							<INPUT class="BigButton" onclick="location='new.aspx'" type="button" value="重填">
						</TD>
					</TR>
				</TABLE>
				<BR>
			</asp:Panel>
			<asp:Literal id="litMessage" runat="server"></asp:Literal>
		</form>
	</body>
</HTML>
